using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Yozeev.SystemConfig
{
    /// <summary>
    /// 权限
    /// </summary>
    public class Power : ByUserEntity<Guid>
    {
        /// <summary>
        /// 菜单标识
        /// </summary>
        public Guid MenuId { get; set; }
        [ForeignKey("MenuId")]
        public virtual Menu Menu { get; set; }
        /// <summary>
        /// 菜单路径
        /// </summary>
        [StringLength(128)]
        public string MenuPath { get; set; }
        /// <summary>
        /// 权限代码
        /// </summary>
        [Required]
        [StringLength(128)]
        public string PowerCode { get; set; }
        /// <summary>
        /// 权限名称
        /// </summary>
        [Required]
        [StringLength(128)]
        public string PowerName { get; set; }
        /// <summary>
        /// 方法
        /// </summary>
        [StringLength(128)]
        public string Method { get; set; }
        /// <summary>
        /// 参数
        /// </summary>
        [StringLength(128)]
        public string Params { get; set; }
        /// <summary>
        /// 分组
        /// </summary>
        [StringLength(128)]
        public string GroupName { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public long? Sort { get; set; }
        /// <summary>
        /// 图标
        /// </summary>
        [StringLength(128)]
        public string IocName { get; set; }
        /// <summary>
        /// 图标地址
        /// </summary>
        [StringLength(128)]
        public string IocClassName { get; set; }
        /// <summary>
        /// <summary>
        /// 权限类型
        /// </summary>
        public PowerTypeEnum Category { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
        public virtual ICollection<PowerRole> PowerRoles { get; set; }
    }
}
